package com.yc.demo.test01;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;
import java.util.Enumeration;
import java.util.List;

@WebServlet(name = "AddXueliServlet", value = "/AddXueliServlet")
public class AddXueliServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        request.setCharacterEncoding("utf-8");
        response.setCharacterEncoding("utf-8");
        response.setContentType("text/html;charset=utf-8");

        String xueli = request.getParameter("xueli");
        request.setAttribute("xueli",xueli);
        HttpSession session = request.getSession();
        session.setAttribute("xueli",xueli);


        response.sendRedirect("test/myself.html");
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }
}
